<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/6/20
 * Time: 16:14
 */

namespace app\admin\controller;


use app\admin\Controller;
use app\common\model\Contact as ContactModel;

class Contact extends Controller
{
    public function index()
    {
        $contact = ContactModel::get(1);
        $this->view->assign('contact', $contact);
        return $this->view->fetch('index');
    }

    public function save()
    {
        $data = $this->request->param()['data'];
        $data['id'] = 1;
        ContactModel::update($data);
        return [
            'code' => 0,
            'msg' => 'success'
        ];
    }
}